Optimal. Leaf size=408 \[ \frac {b \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {b \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {b \left (a^2+b^2\right ) \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \left (a^2+b^2\right ) \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.37, antiderivative size = 408, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 9, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3609, 12,
3566, 714, 1143, 648, 632, 212, 642} \begin {gather*} \frac {b \left (a^2+b^2\right ) \log \left (-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \cot (c+d x)}+\sqrt {a^2+b^2}+a+b \cot (c+d x)\right )}{2 \sqrt {2} d \sqrt {\sqrt {a^2+b^2}+a}}-\frac {b \left (a^2+b^2\right ) \log \left (\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \cot (c+d x)}+\sqrt {a^2+b^2}+a+b \cot (c+d x)\right )}{2 \sqrt {2} d \sqrt {\sqrt {a^2+b^2}+a}}+\frac {b \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a-\sqrt {a^2+b^2}}}-\frac {b \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a-\sqrt {a^2+b^2}}}-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 212
Rule 632
Rule 642
Rule 648
Rule 714
Rule 1143
Rule 3566
Rule 3609
Rubi steps
\begin {align*} \int (-a+b \cot (c+d x)) (a+b \cot (c+d x))^{3/2} \, dx &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\int \left (-a^2-b^2\right ) \sqrt {a+b \cot (c+d x)} \, dx\\ &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\left (-a^2-b^2\right ) \int \sqrt {a+b \cot (c+d x)} \, dx\\ &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {\sqrt {a+x}}{b^2+x^2} \, dx,x,b \cot (c+d x)\right )}{d}\\ &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {\left (2 b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {x^2}{a^2+b^2-2 a x^2+x^4} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{d}\\ &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 d}+\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 d}+\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ &=-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {b \left (a^2+b^2\right ) \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \left (a^2+b^2\right ) \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \cot (c+d x)}\right )}{d}-\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \cot (c+d x)}\right )}{d}\\ &=\frac {b \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {b \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {2 b (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {b \left (a^2+b^2\right ) \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {b \left (a^2+b^2\right ) \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.06, size = 178, normalized size = 0.44 \begin {gather*} \frac {(-a+b \cot (c+d x)) (a+b \cot (c+d x)) \left (3 i \sqrt {a-i b} \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )-3 i \sqrt {a+i b} \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )+2 b (a+b \cot (c+d x))^{3/2}\right ) \sin ^2(c+d x)}{-3 b^2 d \cos ^2(c+d x)+3 a^2 d \sin ^2(c+d x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.63, size = 390, normalized size = 0.96
method | result | size |
derivativedivides | \(-\frac {2 b \left (\frac {\left (a +b \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+\left (-a^{2}-b^{2}\right ) \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \left (\sqrt {a^{2}+b^{2}}-a \right ) \left (\frac {\ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{4 b^{2}}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \left (\sqrt {a^{2}+b^{2}}-a \right ) \left (\frac {\ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{4 b^{2}}\right )\right )}{d}\) | \(390\) |
default | \(-\frac {2 b \left (\frac {\left (a +b \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+\left (-a^{2}-b^{2}\right ) \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \left (\sqrt {a^{2}+b^{2}}-a \right ) \left (\frac {\ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{4 b^{2}}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \left (\sqrt {a^{2}+b^{2}}-a \right ) \left (\frac {\ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{4 b^{2}}\right )\right )}{d}\) | \(390\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int a^{2} \sqrt {a + b \cot {\left (c + d x \right )}}\, dx - \int \left (- b^{2} \sqrt {a + b \cot {\left (c + d x \right )}} \cot ^{2}{\left (c + d x \right )}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.96, size = 2529, normalized size = 6.20 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________